package com.sdgakj.repository;

import com.sdgakj.entity.Actives;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by yl  on 2017/5/17.
 */
public interface ActivesDao extends PagingAndSortingRepository<Actives, Long>,JpaSpecificationExecutor<Actives> {

    @Query(value = "select * from f_actives where fa_status='0' order by createtime desc",nativeQuery = true)
    List<Actives> getActivesByFamilyId();

    @Query(value = "select * from f_actives where p_id=?1 and fa_status=?2",nativeQuery = true)
    List<Actives> getIdByPersonId(Long pId,Long status);
}
